#ifndef SYSTEMACTIVATIONMAINWINDOW_H
#define SYSTEMACTIVATIONMAINWINDOW_H

#include <QMainWindow>
#include <QEvent>
#include <QMouseEvent>
#include <QPainter>
#include <KWindowEffects>
#include <QGSettings>
#include <QHBoxLayout>
#include "qrcodeactivationwidget.h"
#include "ukeyactivationwidget.h"
#include "importlicensefilewidget.h"
#include "deactivatewidget.h"
#include "secretkeyactivationwidget.h"
#include "activation_thread_kms.h"
#include "interface.h"
#include "receive_dbus.h"
#include "activatesucceedwidget.h"
#include "mylabel.h"
#include <kborderlessbutton.h>
#include "socketmanager.h"
#include "Button/fixbutton.h"

namespace Ui {
class SystemActivationMainWindow;
}
using namespace kdk;
class SystemActivationMainWindow : public QMainWindow
{
    Q_OBJECT

public:
//    explicit SystemActivationMainWindow(QWidget *parent = nullptr);
    SystemActivationMainWindow(int argc, char *argv,QWidget *parent = nullptr);
    ~SystemActivationMainWindow();
    activation_thread_kms *m_kmsActivation=nullptr;
    void checkAuthorizationFile();

private slots:
    void on_qrcodebtn_clicked();

    void on_ukeybtn_clicked();

    void on_authfileimportbtn_clicked();

//    void on_deactivatebtn_clicked();

    void on_secretkeybtn_clicked();

    //系统信息发送
    void send_activation_info(QString info);
    int finishedSlot_info(QNetworkReply *registered);


public slots:
    void activationMessageSlot(int activation);
    void slotMessageReceived(const QString&);

protected:
    void checkIfSupportCancel();

private:
    Ui::SystemActivationMainWindow *ui;
    QrCodeActivationWidget *m_qrcodewid=nullptr;
    UkeyActivationWidget *m_ukeyWid=nullptr;
    ImportLicenseFileWidget *m_importLicense=nullptr;
    DeactivateWidget *m_deactivateWid=nullptr;
    QGSettings* m_gsetting=nullptr;
    QUdpSocket *udpSocket=nullptr;
    SecretKeyActivationWidget *m_secretKeyWid=nullptr;
    ActivateSucceedWidget *m_activateSucceed = nullptr;
    KBorderlessButton  *import_auth_file_label = nullptr;
    KBorderlessButton *deactivate_label = nullptr;
    QHBoxLayout *deacAndImporLayout = nullptr;
    QNetworkAccessManager *m_accessManager_Registered = nullptr;

signals:
    void sendObject(QObject *t);
//    void clicked();//修改授权文件label点击信号
};

#endif // SYSTEMACTIVATIONMAINWINDOW_H
